﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace ApiDoc.Extensions
{
    /// <summary>
    /// Extension methods for XElement.
    /// </summary>
    public static class XElementExtensions
    {
        /// <summary>
        /// Returns the Inner XML string for <paramref name="element"/>.
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        public static string GetInnerXml(this XElement element)
        {
            var reader = element.CreateReader();
            reader.MoveToContent();
            string ret = reader.ReadInnerXml();
            return ret;
        }
    }
}
